﻿using System.Windows;
using QDP.Platform.Silverlight;
using QDP.Platform.Silverlight.Controls;

namespace Apps.Common
{
    [WidgetMeta(Category = NParams.CategoryCommon
        , Key = NParams.AutoHideSpan
        , Desc = "自动隐藏触发间隔"
        , DefaultValue = NParams.DEFAULT_AUTO_HIDE_SPAN)]
    [WidgetMeta(Category = NParams.CategoryCommon
        , Key = NParams.Autorun
        , Desc = "表示应用在平台加载完成自动运行"
        , DefaultValue = NParams.False)]
    [WidgetMeta(Category = NParams.CategoryLayout
        , Key = NParams.ColumnSpan
        , Desc = "表示应用自定义磁贴所占列数，整型"
        , DefaultValue = 1)]
    [WidgetMeta(Category = NParams.CategoryLayout
        , Key = NParams.RowSpan
        , Desc = "表示应用自定义磁贴所占列数，整型"
        , DefaultValue = 1)]
    public class ToolbarWidget : PartElement
    {
        public ToolbarWidget()
        {
            WidgetContent = new Metrobar()
            {
                HorizontalAlignment = HorizontalAlignment.Stretch,
                VerticalAlignment = VerticalAlignment.Bottom,
            };
            WidgetParent = Q.MainPage.BottomRoot;
        }
        public override void Close()
        {
            if (MessageBox.Show("导航栏关闭后需要刷新界面才可以打开，是否关闭？"
                , "系统提示", MessageBoxButton.OKCancel) == MessageBoxResult.OK)
            {
                base.Close();
            }
        }
    }
}
